




#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "xaxiswindow.h"
#endif

#include <wx/wxprec.h>

#ifdef __BORLANDC__
#pragma hdrstop
#endif

#ifndef WX_PRECOMP
    #include <wx/wx.h>
#endif

#include "wx/xaxiswindow.h"
#include "wx/chartsizes.h"

IMPLEMENT_DYNAMIC_CLASS(wxXAxisWindow, wxWindow)

BEGIN_EVENT_TABLE(wxXAxisWindow, wxWindow)
  EVT_PAINT(        wxXAxisWindow::OnPaint)
  EVT_LEFT_DOWN(    wxXAxisWindow::OnMouse)
  EVT_LEFT_DCLICK(  wxXAxisWindow::OnMouse)
END_EVENT_TABLE()



//----------------------------------------------------------------------E-+++
wxXAxisWindow::wxXAxisWindow(
	 wxScrolledWindow *parent
):  wxWindow(parent, -1, wxDefaultPosition,
			 wxSize(XAXIS_WIDTH, XAXIS_HEIGHT)),
	m_WinParent(parent) {
	SetBackgroundColour( *wxWHITE );
}


void wxXAxisWindow::SetVirtualMax(
	ChartValue v
) {
	m_XAxis.SetVirtualMax( v );
}


void wxXAxisWindow::SetVirtualMin(
	ChartValue v
) {
	m_XAxis.SetVirtualMin( v );
}


//----------------------------------------------------------------------E-+++
ChartValue wxXAxisWindow::GetVirtualMax() const {
	return ( m_XAxis.GetVirtualMax() );
}


//----------------------------------------------------------------------E-+++
ChartValue wxXAxisWindow::GetVirtualMin() const {
	return ( m_XAxis.GetVirtualMin() );
}


void wxXAxisWindow::SetZoom(
	double z
) {
	m_XAxis.SetZoom( z );
}


//----------------------------------------------------------------------E-+++
double wxXAxisWindow::GetZoom() {
	return ( m_XAxis.GetZoom() );
}


void wxXAxisWindow::SetSizes(
	wxChartSizes *sizes
) {
	m_XAxis.SetSizes( sizes );
}


const wxChartSizes* wxXAxisWindow::GetSizes() const {
	return ( m_XAxis.GetSizes() );
}



void wxXAxisWindow::Draw(
	CHART_HPAINT hp,
	int x,
	int y
) {



	CHART_RECT r;
    m_WinParent->GetViewStart( &r.xscroll, &r.yscroll );
    r.x = x; r.y = y;
	GetClientSize( &r.w, &r.h );




	m_XAxis.Draw( hp, &r );
}


void wxXAxisWindow::OnPaint(
	wxPaintEvent &WXUNUSED(event)
) {
    wxPaintDC dc( this );




	Draw( &dc );
}


void wxXAxisWindow::OnMouse(
	wxMouseEvent &WXUNUSED(event)
) {
}
